<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>手写Promise-then方法中的中断Promise链条</title>
    <script src="./index.js"></script>
</head>

<body>
    <script>
        new Promise((resolve, reject) => {
            resolve(1);
        }).then(value => {
            console.log(value); // 1
            return 2
        }).then(value => {
            console.log(value); // 2
            return new Promise(() => { })
        }).then(value => {
            console.log(value);
            return new Promise(() => { })
        }).then(value => {
            console.log(value);
            return 5;
        })
    </script>
</body>

</html>